package com.nf;

import com.nf.entity.Car1;
import com.nf.entity.Student2;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Map;

public class TestMap {
    public static void main(String[] args){
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");

        Student2 s2 = (Student2)ac.getBean("student2B");

        System.out.println(s2.getName()+","+s2.getAge()+","+s2.getCar1Map());
        for (Map.Entry<String,Car1>  i : s2.getCar1Map().entrySet()) {
            System.out.println(i.getKey()+":"+i.getValue().getName());
        }
    }
}
